package com.aplink.dellcommercial.activities;

import android.os.Bundle;

import com.aplink.dellcommercial.fragments.PriceBookFragment;
import com.aplink.dellcommercial.fragments.PricebookPhotoPagerFragment;
import com.aplink.dellcommercial.fragments.ProductFragment;
import com.aplink.dellcommercial.fragments.ProductPhotoPagerFragment;
import com.aplink.dellcommercial.fragments.PromotionFragment;
import com.aplink.generic.GenericActivity;
import com.aplink.generic.GenericFragment;
import com.aplink.generic.constant.BundleConstant;

public class ProductPhotoPagerActivity extends GenericActivity {

    @Override
    protected GenericFragment getFragment() {
        Bundle bundle = getIntent().getExtras();
        if ( bundle != null ) {
            String parent = bundle.getString( BundleConstant.PARENT );
            if ( parent.equalsIgnoreCase( ProductFragment.class.getSimpleName() ) ) {
                return new ProductPhotoPagerFragment();
            } else if ( parent.equalsIgnoreCase( PriceBookFragment.class
                    .getSimpleName() ) ) {
                return new PricebookPhotoPagerFragment();
            } else if ( parent.equalsIgnoreCase( PromotionFragment.class
                    .getSimpleName() ) ) {
                return new ProductPhotoPagerFragment();
            }
        }
        return null;
    }
}
